<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<link rel="stylesheet" href="//cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap.min.css">
	<title>管理分类</title>
</head>
<body>
<div class="container" style="margin-top:25px">
	{% if listImg %}
		<form action="{{ url_for("api.classAddImg") }}" method="post">
			<fieldset>
				<legend>Classification</legend>
				<label>添加图片</label><br/>
				<textarea placeholder="I love urls..." rows="10" class="form-control" name="urls"></textarea>
				<span class="help-block">请输入要添加的图片的url</span>
				<input type="hidden" name="class_id" value="{{ me.get('_id') }}">
				<input type="hidden" name="me" value="{{ meJson }}">
				<button type="submit" class="btn btn-large btn-primary">添加</button>
			</fieldset>
		</form>
		<hr style="height:5px;border:none;border-top:5px ridge green;" />
		<!-- <hr style="height:10px;border:none;border-top:10px groove skyblue;" /> -->
		<div class="row">
			{% set data = me.get('image') %}
			{% for pic in data %}
				<div class="col-md-3">  
					<img src="{{ pic.url }}" alt="{{ pic.authorId }}" class="img-thumbnail">
                    <form action="{{ url_for("api.classRemoveImg") }}" method="POST">
                        <input type="hidden" name="class_id" value="{{ me.get('_id') }}">
                        <input type="hidden" name="me" value="{{ meJson }}">
                        <input type="hidden" name="url" value="{{ pic.url }}">
                        <button type="submit" class="btn btn-danger">删除</button>
                    </form>
				</div>

			{% endfor %}
		</div>
	{% endif %}

	{% if content %}
		<div class="row">
		{% for c in content%}
			<div class="col-md-3">  
				<a href="{{ url_for('api.classAdmin', cid=c.id) }}">
					<img src="{{c.icon}}" alt="{{ c.name }}" class="img-rounded center-block">
				</a>
				<div class="caption">
					<h3 align="center">{{ c.name }}</h3>
				</div>
			</div>
		{% endfor %}
		</div>
	{% endif %}
</div>
</body>
</html>